import Vue from 'vue'
import VueRouter from 'vue-router'

const Login = () => import('views/Login')
const Home = () => import ('views/Home')
const Fnav = () => import('views/HomeChild/Fnav')
const Snav = () => import('views/HomeChild/Snav')
const Tnav = () => import('views/HomeChild/Tnav')
const BasicLine = () => import('views/HomeChild/SnavChild/BasicLine')
const SmoLine = () => import('views/HomeChild/SnavChild/SmoLine')
const AreaPieces = () => import('views/HomeChild/SnavChild/AreaPieces')


Vue.use(VueRouter)


const routes = [
  {
    path:'',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/home',
    component: Home,
    meta: { 
      title: '导航栏'
     },
     children: [
       {
         path: 'firstnav',
         component: Fnav 
      },
      {
        path: 'thirdnav',
        component: Tnav
      },
      {
        path: 'secondnav',
        component: Snav ,
        meta: {
          title: 'ECharts'
        },
        children: [
          {
            path: 'BasicLine',
            component: BasicLine,
          },
          {
            path: 'SmoLine',
            component: SmoLine
          },
          {
            path: 'AreaPieces',
            component: AreaPieces
          }
        ]
     },
     ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
